﻿webpackJsonp([3], {
    132: function (t, e) {
    }, 137: function (t, e, o) {
        var n, i;
        !function () {
            function o(t) {
                var e = t.naturalWidth;
                if (e * t.naturalHeight > 1048576) {
                    var o = document.createElement('canvas');
                    o.width = o.height = 1;
                    var n = o.getContext('2d');
                    return n.drawImage(t, 1 - e, 0), 0 === n.getImageData(0, 0, 1, 1).data[3];
                }
                return !1;
            }

            function r(t, e, o) {
                var n = document.createElement('canvas');
                n.width = 1, n.height = o;
                var i = n.getContext('2d');
                i.drawImage(t, 0, 0);
                for (var r = i.getImageData(0, 0, 1, o).data, a = 0, s = o, c = o; c > a;) {
                    0 === r[4 * (c - 1) + 3] ? s = c : a = c, c = s + a >> 1;
                }
                var l = c / o;
                return 0 === l ? 1 : l;
            }

            function a(t, e, o) {
                var n = document.createElement('canvas');
                return s(t, n, e, o), n.toDataURL('image/jpeg', e.quality || .8);
            }

            function s(t, e, n, i) {
                var a = t.naturalWidth, s = t.naturalHeight;
                if (a + s) {
                    var l = n.width, u = n.height, h = e.getContext('2d');
                    h.save(), c(e, h, l, u, n.orientation);
                    o(t) && (a /= 2, s /= 2);
                    var g = 1024, f = document.createElement('canvas');
                    f.width = f.height = g;
                    for (var d = f.getContext('2d'), p = i ? r(t, a, s) : 1, m = Math.ceil(g * l / a), v = Math.ceil(g * u / s / p), b = 0, x = 0; b < s;) {
                        for (var y = 0, w = 0; y < a;) d.clearRect(0, 0, g, g), d.drawImage(t, -y, -b), h.drawImage(f, 0, 0, g, g, w, x, m, v), y += g, w += m;
                        b += g, x += v;
                    }
                    h.restore(), f = d = null;
                }
            }

            function c(t, e, o, n, i) {
                switch (i) {
                    case 5:
                    case 6:
                    case 7:
                    case 8:
                        t.width = n, t.height = o;
                        break;
                    default:
                        t.width = o, t.height = n;
                }
                switch (i) {
                    case 2:
                        e.translate(o, 0), e.scale(-1, 1);
                        break;
                    case 3:
                        e.translate(o, n), e.rotate(Math.PI);
                        break;
                    case 4:
                        e.translate(0, n), e.scale(1, -1);
                        break;
                    case 5:
                        e.rotate(.5 * Math.PI), e.scale(1, -1);
                        break;
                    case 6:
                        e.rotate(.5 * Math.PI), e.translate(0, -n);
                        break;
                    case 7:
                        e.rotate(.5 * Math.PI), e.translate(o, -n), e.scale(-1, 1);
                        break;
                    case 8:
                        e.rotate(-.5 * Math.PI), e.translate(-o, 0);
                }
            }

            function l(t) {
                if (window.Blob && t instanceof Blob) {
                    if (!u) throw Error('No createObjectURL function found to create blob url');
                    var e = new Image;
                    e.src = u.createObjectURL(t), this.blob = t, t = e;
                }
                if (!t.naturalWidth && !t.naturalHeight) {
                    var o = this;
                    t.onload = t.onerror = function () {
                        var t = o.imageLoadListeners;
                        if (t) {
                            o.imageLoadListeners = null;
                            for (var e = 0, n = t.length; e < n; e++) t[e]();
                        }
                    }, this.imageLoadListeners = [];
                }
                this.srcImage = t;
            }

            var u = window.URL && window.URL.createObjectURL ? window.URL : window.webkitURL && window.webkitURL.createObjectURL ? window.webkitURL : null;
            l.prototype.render = function (t, e, o) {
                if (this.imageLoadListeners) {
                    var n = this;
                    return void this.imageLoadListeners.push(function () {
                        n.render(t, e, o);
                    });
                }
                e = e || {};
                var i = this.srcImage.naturalWidth, r = this.srcImage.naturalHeight, c = e.width, l = e.height,
                    h = e.maxWidth, g = e.maxHeight, f = !this.blob || 'image/jpeg' === this.blob.type;
                c && !l ? l = r * c / i << 0 : l && !c ? c = i * l / r << 0 : (c = i, l = r), h && c > h && (c = h, l = r * c / i << 0), g && l > g && (l = g, c = i * l / r << 0);
                var d = {width: c, height: l};
                for (var p in e) d[p] = e[p];
                var m = t.tagName.toLowerCase();
                'img' === m ? t.src = a(this.srcImage, d, f) : 'canvas' === m && s(this.srcImage, t, d, f), 'function' == typeof this.onrender && this.onrender(t), o && o(), this.blob && (this.blob = null, u.revokeObjectURL(this.srcImage.src));
            }, n = [], void 0 !== (i = function () {
                return l;
            }.apply(e, n)) && (t.exports = i);
        }();
    }, 15: function (t, e, o) {
        (function (e) {
            function n(t) {
                t && t.params && e.extend(a, t.params), i({
                    url: r,
                    type: t.type,
                    data: a,
                    beforeSend: t.beforeSend,
                    callback: t.callback
                });
            }

            var i = o(2), r = '/common/user', a = {type: ''};
            t.exports = n;
        }).call(e, o(0));
    }, 160: function (t, e, o) {
        (function (t) {
            !function (t, e) {
                'use strict';

                function o(t, e) {
                    return Math.pow(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2), .5);
                }

                function n(t, e) {
                    return {x: (t.x + e.x) / 2, y: (t.y + e.y) / 2};
                }

                function i(e) {
                    var o = this.$objects.width(), n = this.$objects.height(), i = this.$objects.offset().top,
                        r = this.$objects.offset().left;
                    t.extend(this.opts.originPoint, {
                        x: (e.x - r) / this.opts.zoomNumber,
                        y: (e.y - i) / this.opts.zoomNumber
                    }), this.opts.originPoint.x < 0 ? this.opts.originPoint.x = 0 : this.opts.originPoint.x > o && (this.opts.originPoint.x = o), this.opts.originPoint.y < 0 ? this.opts.originPoint.y = 0 : this.opts.originPoint.y > n && (this.opts.originPoint.y = n), this.$objects.prefix({'transform-origin': this.opts.originPoint.x + 'px ' + this.opts.originPoint.y + 'px 0'});
                }

                function r() {
                    var t = this.$objects.width(), e = this.$objects.height(), o = this.opts.viewWidth,
                        n = this.opts.viewHeight;
                    return {
                        top: (this.opts.zoomNumber - 1) * this.opts.originPoint.y + (e - n) / 2,
                        right: -(this.opts.zoomNumber - 1) * (t - this.opts.originPoint.x) - (t - o) / 2,
                        bottom: -(this.opts.zoomNumber - 1) * (e - this.opts.originPoint.y) - (e - n) / 2,
                        left: (this.opts.zoomNumber - 1) * this.opts.originPoint.x + (t - o) / 2
                    };
                }

                function a() {
                    this.opts.zoomNumber < this.opts.minZoomNumber ? this.opts.zoomNumber = this.opts.minZoomNumber : this.opts.zoomNumber > this.opts.maxZoomNumber && (this.opts.zoomNumber = this.opts.maxZoomNumber);
                    var e = r.call(this);
                    this.opts.movePosition.x > e.left ? this.opts.movePosition.x = e.left : this.opts.movePosition.x < e.right && (this.opts.movePosition.x = e.right), this.opts.movePosition.y > e.top ? this.opts.movePosition.y = e.top : this.opts.movePosition.y < e.bottom && (this.opts.movePosition.y = e.bottom), this.$objects.prefix({
                        transition: 'transform .3s',
                        transform: 'translate(' + this.opts.movePosition.x + 'px, ' + this.opts.movePosition.y + 'px) scale(' + this.opts.zoomNumber + ')'
                    }), this.opts.callback && t.isFunction(this.opts.callback) && this.opts.callback();
                }

                function s(t) {
                    var e = r.call(this);
                    return t.x > e.left ? t.x = (t.x - e.left) / 3 + e.left : t.x < e.right && (t.x = (t.x - e.right) / 3 + e.right), t.y > e.top ? t.y = (t.y - e.top) / 3 + e.top : t.y < e.bottom && (t.y = (t.y - e.bottom) / 3 + e.bottom), t;
                }

                function c() {
                    var e = this, r = {x: 0, y: 0, t: 0}, c = {x: 0, y: 0, t: 0}, l = {x: 0, y: 0, t: 0},
                        u = {x: 0, y: 0, t: 0}, h = {x: 0, y: 0}, g = 0, f = 0, d = 'none';
                    this.$el.on('touchstart', function (t) {
                        t.preventDefault(), t.stopPropagation(), r.x = t.originalEvent.touches[0].pageX, r.y = t.originalEvent.touches[0].pageY, r.t = (new Date).getTime(), t.originalEvent.touches.length > 1 && (c.x = t.originalEvent.touches[1].pageX, c.y = t.originalEvent.touches[1].pageY, c.t = (new Date).getTime(), g = o(r, c), h = n(r, c), i.call(e, h));
                    }), this.$el.on('touchmove', function (t) {
                        if (t.preventDefault(), t.stopPropagation(), l.x = t.originalEvent.touches[0].pageX, l.y = t.originalEvent.touches[0].pageY, l.t = (new Date).getTime(), 'none' === d && t.originalEvent.touches.length > 1 || 'zoom' === d) u.x = t.originalEvent.touches[1].pageX, u.y = t.originalEvent.touches[1].pageY, u.t = (new Date).getTime(), d = 'zoom', f = o(l, u), e.$objects.prefix({
                            transition: 'transform 0s',
                            transform: 'translate(' + e.opts.movePosition.x + 'px, ' + e.opts.movePosition.y + 'px) scale(' + e.opts.zoomNumber * f / g + ')'
                        }); else {
                            d = 'move';
                            var n = {x: e.opts.movePosition.x + l.x - r.x, y: e.opts.movePosition.y + l.y - r.y};
                            n = s.call(e, n), e.$objects.prefix({
                                transition: 'transform 0s',
                                transform: 'translate(' + n.x + 'px, ' + n.y + 'px) scale(' + e.opts.zoomNumber + ')'
                            });
                        }
                    }), this.$el.on('touchend', function (s) {
                        switch (s.preventDefault(), s.stopPropagation(), d) {
                            case'zoom':
                                e.opts.zoomNumber = e.opts.zoomNumber * f / g, a.call(e);
                                break;
                            case'move':
                                t.extend(e.opts.movePosition, {
                                    x: e.opts.movePosition.x + l.x - r.x,
                                    y: e.opts.movePosition.y + l.y - r.y
                                }), a.call(e);
                                break;
                            default:
                                return;
                        }
                        d = 'none', s.originalEvent.touches.length > 0 && (r.x = s.originalEvent.touches[0].pageX, r.y = s.originalEvent.touches[0].pageY, r.t = (new Date).getTime(), s.originalEvent.touches.length > 1 && (c.x = s.originalEvent.touches[1].pageX, c.y = s.originalEvent.touches[1].pageY, c.t = (new Date).getTime(), g = o(r, c), h = n(r, c), i.call(e, h)));
                    });
                }

                function l(e, o) {
                    this.$el = e, this.opts = t.extend({}, g, o), this.$objects = e.find(this.opts.objects), c.call(this);
                }

                function u(e) {
                    return new l(t(this), e);
                }

                var h = t(window).width(), g = {
                    objects: '#canvas',
                    viewWidth: h,
                    viewHeight: h,
                    zoomNumber: 1,
                    minZoomNumber: 1,
                    maxZoomNumber: 3,
                    movePosition: {x: 0, y: 0},
                    originPoint: {x: 0, y: 0},
                    callback: null
                };
                l.prototype.reset = function () {
                    this.opts.movePosition.x = 0, this.opts.movePosition.y = 0, this.opts.originPoint.x = 0, this.opts.originPoint.y = 0, this.opts.zoomNumber = 1, this.$objects.prefix({
                        transition: 'transform 0s',
                        transform: 'translate(' + this.opts.movePosition.x + 'px, ' + this.opts.movePosition.y + 'px) scale(' + this.opts.zoomNumber + ')'
                    });
                }, t.fn.zoomMove = u;
            }(t);
        }).call(e, o(0));
    }, 20: function (t, e, o) {
        (function (e) {
            function n(t, o) {
                var n = 'layerTip' + (+new Date).toString() + Math.floor(1e4 * Math.random()).toString();
                e('body').append(i({id: n, loading: !1, info: t}));
                var r = e('#' + n);
                r.on('touchmove', function (t) {
                    t.preventDefault();
                }), r.on('tap', function (t) {
                    t.preventDefault(), t.stopPropagation(), e(this).remove(), o && e.isFunction(o) && o();
                }), setTimeout(function () {
                    r.length && (r.remove(), o && e.isFunction(o) && o());
                }, 1e3);
            }

            var i = o(22);
            t.exports = n;
        }).call(e, o(0));
    }, 22: function (t, e, o) {
        t.exports = function (t) {
            var e = '<section class="layer-tip" id="' + t.id + '"> <div class="tip-body"> ';
            return t.loading && (e += ' <img class="loading" src="' + o(26) + '" /> '), e += ' <div class="info">' + t.info + '</div> </div></section>';
        };
    }, 25: function (t, e) {
        t.exports = function (t) {
            return '<div class="page-loading" id="page-loading"> <svg width="48" height="20" version="1.1" xmlns="http://www.w3.org/2000/svg"> <g fill="#d9d9d9"> <circle cx="8" cy="10" r="3"> <animate id="a" attributeName="r" values="7;3;3;3;7" dur="2s" calcMode="paced" repeatCount="indefinite" /> </circle> <circle cx="24" cy="10" r="3"> <animate id="a" attributeName="r" values="3;7;3;7;3" dur="2s" calcMode="paced" repeatCount="indefinite" /> </circle> <circle cx="40" cy="10" r="3"> <animate id="a" attributeName="r" values="3;3;7;3;3" dur="2s" calcMode="paced" repeatCount="indefinite" /> </circle> </g> </svg></div>';
        };
    }, 258: function (t, e, o) {
        (function (t) {
            o(132), o(1), o(11), o(160), o(7);
            var e = o(54), n = o(137), i = (o(12), o(3), o(15)), r = o(38), a = o(20), s = o(35);
            o(25);
            t(function () {
                function o(t, e) {
                    if (t > e) {
                        var o = l * t / e;
                        w.width = o, w.height = l, w.top = (u - l) / 2, w.left = (l - o) / 2, v.css(w);
                    } else {
                        var n = l * e / t;
                        w.width = l, w.height = n, w.top = (u - n) / 2, w.left = 0, v.css(w);
                    }
                }

                var c = t(window), l = c.width(), u = c.height(), h = (t('body'), t('.header-body')), g = t('#file'),
                    f = t('#upload'), d = t('#picture-container'), p = t('#canvas-container'), m = t('#portrait'),
                    v = t('#canvas'), b = t('#cancel'), x = t('#ok'), y = null;
                y ? m.attr('src', y) : i({
                    params: {type: 'detail'}, beforeSend: function () {
                        s.open('图片加载中');
                    }, callback: function (t, e) {
                        // if ('success' === t) {
                            var o = new Image;
                            o.src = e.pictureUrl, o.onload = function () {
                                s.close(), m.attr('src', this.src), y = this.src;
                            }, o.onerror = function () {
                                s.close();
                            };
                        // } else a('登录超时，请重新登录', function () {
                            // window.location.href = 'login.html';
                        // });
                    }
                }), d.zoomMove({objects: '#portrait'});
                var w = {width: 0, height: 0, top: 0, left: 0};
                p.find('.view').css({height: l}), p.find('.view-out').css({height: (u - l) / 2});
                var P = p.zoomMove();
                h.on('touchmove', function (t) {
                    t.preventDefault();
                }), f.on('tap', function (t) {
                    g.trigger('click');
                }), g.on('change', function (t) {
                    var i = t.currentTarget.files[0], r = new FileReader;
                    p.removeClass('hide'), r.readAsDataURL(i), r.onload = function (t) {
                        var i = new Image;
                        i.src = t.target.result, i.onload = function () {
                            var t = new n(this), i = v[0];
                            e.getData(this, function () {
                                var n = e.getTag(this, 'Orientation');
                                switch (t.render(i, {orientation: n}), n) {
                                    case 5:
                                    case 6:
                                    case 7:
                                    case 8:
                                        o(this.naturalHeight, this.naturalWidth);
                                        break;
                                    default:
                                        o(this.naturalWidth, this.naturalHeight);
                                }
                            }), P.reset();
                        };
                    };
                }), b.on('tap', function (t) {
                    g.val(''), p.addClass('hide');
                }), x.on('tap', function (e) {
                    var o = v[0], n = o.getContext('2d'), i = document.createElement('canvas'), c = i.getContext('2d'),
                        l = v.width(), u = v.height(), h = P.opts.viewWidth, f = P.opts.viewHeight,
                        d = P.opts.zoomNumber, b = P.opts.movePosition, x = P.opts.originPoint,
                        w = (l - h) / 2 + x.x * (d - 1), S = (u - f) / 2 + x.y * (d - 1), C = o.width / (l * d),
                        I = Math.floor(h * C), D = Math.floor((w - b.x) * C), F = Math.floor((S - b.y) * C),
                        U = n.getImageData(D, F, I, I);
                    i.width = i.height = I, c.putImageData(U, 0, 0);
                    var N = i.toDataURL('image/png');
                    r({
                        type: 'POST', params: {pictureUrl: N}, beforeSend: function () {
                            s.open('图片上传中');
                        }, callback: function (e, o) {
                            t('#page-loading').remove(), 'success' === e ? (s.close(), a('上传成功'), m.attr('src', N), y = N, i.remove(), g.val(''), p.addClass('hide')) : (s.close(), m.attr('src', y), a('上传失败'));
                        }
                    });
                });
            });
        }).call(e, o(0));
    }, 26: function (t, e, o) {
        t.exports = o.p + 'static/img/loading.gif';
    }, 35: function (t, e, o) {
        (function (e) {
            function n(t) {
                e('body').append(r({id: a, loading: !0, info: t})), e('#' + a).on('touchmove', function (t) {
                    t.preventDefault();
                });
            }

            function i() {
                e('#' + a).remove();
            }

            var r = o(22), a = 'layerTip' + (+new Date).toString() + Math.floor(1e4 * Math.random()).toString();
            t.exports = {open: n, close: i};
        }).call(e, o(0));
    }, 38: function (t, e, o) {
        (function (e) {
            function n(t) {
                t && t.params && e.extend(u, t.params), c({
                    callback: function (e, o) {
                        'success' === e ? a({
                            url: l,
                            type: t.type,
                            data: u,
                            beforeSend: t.beforeSend,
                            callback: t.callback
                        }) : s('登录超时，请重新登录', function () {
                            window.location.href = i.prefix + r.getCity() + '/user/login';
                        });
                    }
                });
            }

            var i = o(12), r = o(3), a = o(2), s = o(20), c = o(15), l = '/common/user/update',
                u = {name: '', pictureUrl: ''};
            t.exports = n;
        }).call(e, o(0));
    }, 54: function (t, e, o) {
        var i, r;
        (function () {
            function o(t) {
                return !!t.exifdata;
            }

            function a(t, e) {
                e = e || t.match(/^data\:([^\;]+)\;base64,/im)[1] || '', t = t.replace(/^data\:([^\;]+)\;base64,/gim, '');
                for (var o = atob(t), n = o.length, i = new ArrayBuffer(n), r = new Uint8Array(i), a = 0; a < n; a++) r[a] = o.charCodeAt(a);
                return i;
            }

            function s(t, e) {
                var o = new XMLHttpRequest;
                o.open('GET', t, !0), o.responseType = 'blob', o.onload = function (t) {
                    200 != this.status && 0 !== this.status || e(this.response);
                }, o.send();
            }

            function c(t, e) {
                function o(o) {
                    var n = l(o);
                    t.exifdata = n || {};
                    var i = u(o);
                    if (t.iptcdata = i || {}, P.isXmpEnabled) {
                        var r = b(o);
                        t.xmpdata = r || {};
                    }
                    e && e.call(t);
                }

                if (t.src) if (/^data\:/i.test(t.src)) {
                    var n = a(t.src);
                    o(n);
                } else if (/^blob\:/i.test(t.src)) {
                    var i = new FileReader;
                    i.onload = function (t) {
                        o(t.target.result);
                    }, s(t.src, function (t) {
                        i.readAsArrayBuffer(t);
                    });
                } else {
                    var r = new XMLHttpRequest;
                    r.onload = function () {
                        if (200 != this.status && 0 !== this.status) throw'Could not load image';
                        o(r.response), r = null;
                    }, r.open('GET', t.src, !0), r.responseType = 'arraybuffer', r.send(null);
                } else if (self.FileReader && (t instanceof self.Blob || t instanceof self.File)) {
                    var i = new FileReader;
                    i.onload = function (t) {
                        w && console.log('Got file of length ' + t.target.result.byteLength), o(t.target.result);
                    }, i.readAsArrayBuffer(t);
                }
            }

            function l(t) {
                var e = new DataView(t);
                if (w && console.log('Got file of length ' + t.byteLength), 255 != e.getUint8(0) || 216 != e.getUint8(1)) return w && console.log('Not a valid JPEG'), !1;
                for (var o, n = 2, i = t.byteLength; n < i;) {
                    if (255 != e.getUint8(n)) return w && console.log('Not a valid marker at offset ' + n + ', found: ' + e.getUint8(n)), !1;
                    if (o = e.getUint8(n + 1), w && console.log(o), 225 == o) return w && console.log('Found 0xFFE1 marker'), v(e, n + 4, e.getUint16(n + 2));
                    n += 2 + e.getUint16(n + 2);
                }
            }

            function u(t) {
                var e = new DataView(t);
                if (w && console.log('Got file of length ' + t.byteLength), 255 != e.getUint8(0) || 216 != e.getUint8(1)) return w && console.log('Not a valid JPEG'), !1;
                for (var o = 2, n = t.byteLength; o < n;) {
                    if (function (t, e) {
                        return 56 === t.getUint8(e) && 66 === t.getUint8(e + 1) && 73 === t.getUint8(e + 2) && 77 === t.getUint8(e + 3) && 4 === t.getUint8(e + 4) && 4 === t.getUint8(e + 5);
                    }(e, o)) {
                        var i = e.getUint8(o + 7);
                        i % 2 != 0 && (i += 1), 0 === i && (i = 4);
                        return h(t, o + 8 + i, e.getUint16(o + 6 + i));
                    }
                    o++;
                }
            }

            function h(t, e, o) {
                for (var n, i, r, a, s = new DataView(t), c = {}, l = e; l < e + o;) 28 === s.getUint8(l) && 2 === s.getUint8(l + 1) && (a = s.getUint8(l + 2)) in U && (r = s.getInt16(l + 3), r + 5, i = U[a], n = m(s, l + 5, r), c.hasOwnProperty(i) ? c[i] instanceof Array ? c[i].push(n) : c[i] = [c[i], n] : c[i] = n), l++;
                return c;
            }

            function g(t, e, o, n, i) {
                var r, a, s, c = t.getUint16(o, !i), l = {};
                for (s = 0; s < c; s++) r = o + 12 * s + 2, a = n[t.getUint16(r, !i)], !a && w && console.log('Unknown tag: ' + t.getUint16(r, !i)), l[a] = f(t, r, e, o, i);
                return l;
            }

            function f(t, e, o, n, i) {
                var r, a, s, c, l, u, h = t.getUint16(e + 2, !i), g = t.getUint32(e + 4, !i),
                    f = t.getUint32(e + 8, !i) + o;
                switch (h) {
                    case 1:
                    case 7:
                        if (1 == g) return t.getUint8(e + 8, !i);
                        for (r = g > 4 ? f : e + 8, a = [], c = 0; c < g; c++) a[c] = t.getUint8(r + c);
                        return a;
                    case 2:
                        return r = g > 4 ? f : e + 8, m(t, r, g - 1);
                    case 3:
                        if (1 == g) return t.getUint16(e + 8, !i);
                        for (r = g > 2 ? f : e + 8, a = [], c = 0; c < g; c++) a[c] = t.getUint16(r + 2 * c, !i);
                        return a;
                    case 4:
                        if (1 == g) return t.getUint32(e + 8, !i);
                        for (a = [], c = 0; c < g; c++) a[c] = t.getUint32(f + 4 * c, !i);
                        return a;
                    case 5:
                        if (1 == g) return l = t.getUint32(f, !i), u = t.getUint32(f + 4, !i), s = new Number(l / u), s.numerator = l, s.denominator = u, s;
                        for (a = [], c = 0; c < g; c++) l = t.getUint32(f + 8 * c, !i), u = t.getUint32(f + 4 + 8 * c, !i), a[c] = new Number(l / u), a[c].numerator = l, a[c].denominator = u;
                        return a;
                    case 9:
                        if (1 == g) return t.getInt32(e + 8, !i);
                        for (a = [], c = 0; c < g; c++) a[c] = t.getInt32(f + 4 * c, !i);
                        return a;
                    case 10:
                        if (1 == g) return t.getInt32(f, !i) / t.getInt32(f + 4, !i);
                        for (a = [], c = 0; c < g; c++) a[c] = t.getInt32(f + 8 * c, !i) / t.getInt32(f + 4 + 8 * c, !i);
                        return a;
                }
            }

            function d(t, e, o) {
                var n = t.getUint16(e, !o);
                return t.getUint32(e + 2 + 12 * n, !o);
            }

            function p(t, e, o, n) {
                var i = d(t, e + o, n);
                if (!i) return {};
                if (i > t.byteLength) return {};
                var r = g(t, e, e + i, D, n);
                if (r.Compression) switch (r.Compression) {
                    case 6:
                        if (r.JpegIFOffset && r.JpegIFByteCount) {
                            var a = e + r.JpegIFOffset, s = r.JpegIFByteCount;
                            r.blob = new Blob([new Uint8Array(t.buffer, a, s)], {type: 'image/jpeg'});
                        }
                        break;
                    case 1:
                        console.log('Thumbnail image format is TIFF, which is not implemented.');
                        break;
                    default:
                        console.log('Unknown thumbnail image format \'%s\'', r.Compression);
                } else 2 == r.PhotometricInterpretation && console.log('Thumbnail image format is RGB, which is not implemented.');
                return r;
            }

            function m(t, e, o) {
                var i = '';
                for (n = e; n < e + o; n++) i += String.fromCharCode(t.getUint8(n));
                return i;
            }

            function v(t, e) {
                if ('Exif' != m(t, e, 4)) return w && console.log('Not valid EXIF data! ' + m(t, e, 4)), !1;
                var o, n, i, r, a, s = e + 6;
                if (18761 == t.getUint16(s)) o = !1; else {
                    if (19789 != t.getUint16(s)) return w && console.log('Not valid TIFF data! (no 0x4949 or 0x4D4D)'), !1;
                    o = !0;
                }
                if (42 != t.getUint16(s + 2, !o)) return w && console.log('Not valid TIFF data! (no 0x002A)'), !1;
                var c = t.getUint32(s + 4, !o);
                if (c < 8) return w && console.log('Not valid TIFF data! (First offset less than 8)', t.getUint32(s + 4, !o)), !1;
                if (n = g(t, s, s + c, C, o), n.ExifIFDPointer) {
                    r = g(t, s, s + n.ExifIFDPointer, S, o);
                    for (i in r) {
                        switch (i) {
                            case'LightSource':
                            case'Flash':
                            case'MeteringMode':
                            case'ExposureProgram':
                            case'SensingMethod':
                            case'SceneCaptureType':
                            case'SceneType':
                            case'CustomRendered':
                            case'WhiteBalance':
                            case'GainControl':
                            case'Contrast':
                            case'Saturation':
                            case'Sharpness':
                            case'SubjectDistanceRange':
                            case'FileSource':
                                r[i] = F[i][r[i]];
                                break;
                            case'ExifVersion':
                            case'FlashpixVersion':
                                r[i] = String.fromCharCode(r[i][0], r[i][1], r[i][2], r[i][3]);
                                break;
                            case'ComponentsConfiguration':
                                r[i] = F.Components[r[i][0]] + F.Components[r[i][1]] + F.Components[r[i][2]] + F.Components[r[i][3]];
                        }
                        n[i] = r[i];
                    }
                }
                if (n.GPSInfoIFDPointer) {
                    a = g(t, s, s + n.GPSInfoIFDPointer, I, o);
                    for (i in a) {
                        switch (i) {
                            case'GPSVersionID':
                                a[i] = a[i][0] + '.' + a[i][1] + '.' + a[i][2] + '.' + a[i][3];
                        }
                        n[i] = a[i];
                    }
                }
                return n.thumbnail = p(t, s, c, o), n;
            }

            function b(t) {
                if ('DOMParser' in self) {
                    var e = new DataView(t);
                    if (w && console.log('Got file of length ' + t.byteLength), 255 != e.getUint8(0) || 216 != e.getUint8(1)) return w && console.log('Not a valid JPEG'), !1;
                    for (var o = 2, n = t.byteLength, i = new DOMParser; o < n - 4;) {
                        if ('http' == m(e, o, 4)) {
                            var r = o - 1, a = e.getUint16(o - 2) - 1, s = m(e, r, a), c = s.indexOf('xmpmeta>') + 8;
                            s = s.substring(s.indexOf('<x:xmpmeta'), c);
                            var l = s.indexOf('x:xmpmeta') + 10;
                            s = s.slice(0, l) + 'xmlns:Iptc4xmpCore="http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tiff="http://ns.adobe.com/tiff/1.0/" xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus" xmlns:ext="http://www.gettyimages.com/xsltExtension/1.0" xmlns:exif="http://ns.adobe.com/exif/1.0/" xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/" xmlns:xapGImg="http://ns.adobe.com/xap/1.0/g/img/" xmlns:Iptc4xmpExt="http://iptc.org/std/Iptc4xmpExt/2008-02-29/" ' + s.slice(l);
                            return y(i.parseFromString(s, 'text/xml'));
                        }
                        o++;
                    }
                }
            }

            function x(t) {
                var e = {};
                if (1 == t.nodeType) {
                    if (t.attributes.length > 0) {
                        e['@attributes'] = {};
                        for (var o = 0; o < t.attributes.length; o++) {
                            var n = t.attributes.item(o);
                            e['@attributes'][n.nodeName] = n.nodeValue;
                        }
                    }
                } else if (3 == t.nodeType) return t.nodeValue;
                if (t.hasChildNodes()) for (var i = 0; i < t.childNodes.length; i++) {
                    var r = t.childNodes.item(i), a = r.nodeName;
                    if (null == e[a]) e[a] = x(r); else {
                        if (null == e[a].push) {
                            var s = e[a];
                            e[a] = [], e[a].push(s);
                        }
                        e[a].push(x(r));
                    }
                }
                return e;
            }

            function y(t) {
                try {
                    var e = {};
                    if (t.children.length > 0) for (var o = 0; o < t.children.length; o++) {
                        var n = t.children.item(o), i = n.attributes;
                        for (var r in i) {
                            var a = i[r], s = a.nodeName, c = a.nodeValue;
                            void 0 !== s && (e[s] = c);
                        }
                        var l = n.nodeName;
                        if (void 0 === e[l]) e[l] = x(n); else {
                            if (void 0 === e[l].push) {
                                var u = e[l];
                                e[l] = [], e[l].push(u);
                            }
                            e[l].push(x(n));
                        }
                    } else e = t.textContent;
                    return e;
                } catch (t) {
                    console.log(t.message);
                }
            }

            var w = !1, P = function (t) {
                return t instanceof P ? t : this instanceof P ? void(this.EXIFwrapped = t) : new P(t);
            };
            void 0 !== t && t.exports && (e = t.exports = P), e.EXIF = P;
            var S = P.Tags = {
                36864: 'ExifVersion',
                40960: 'FlashpixVersion',
                40961: 'ColorSpace',
                40962: 'PixelXDimension',
                40963: 'PixelYDimension',
                37121: 'ComponentsConfiguration',
                37122: 'CompressedBitsPerPixel',
                37500: 'MakerNote',
                37510: 'UserComment',
                40964: 'RelatedSoundFile',
                36867: 'DateTimeOriginal',
                36868: 'DateTimeDigitized',
                37520: 'SubsecTime',
                37521: 'SubsecTimeOriginal',
                37522: 'SubsecTimeDigitized',
                33434: 'ExposureTime',
                33437: 'FNumber',
                34850: 'ExposureProgram',
                34852: 'SpectralSensitivity',
                34855: 'ISOSpeedRatings',
                34856: 'OECF',
                37377: 'ShutterSpeedValue',
                37378: 'ApertureValue',
                37379: 'BrightnessValue',
                37380: 'ExposureBias',
                37381: 'MaxApertureValue',
                37382: 'SubjectDistance',
                37383: 'MeteringMode',
                37384: 'LightSource',
                37385: 'Flash',
                37396: 'SubjectArea',
                37386: 'FocalLength',
                41483: 'FlashEnergy',
                41484: 'SpatialFrequencyResponse',
                41486: 'FocalPlaneXResolution',
                41487: 'FocalPlaneYResolution',
                41488: 'FocalPlaneResolutionUnit',
                41492: 'SubjectLocation',
                41493: 'ExposureIndex',
                41495: 'SensingMethod',
                41728: 'FileSource',
                41729: 'SceneType',
                41730: 'CFAPattern',
                41985: 'CustomRendered',
                41986: 'ExposureMode',
                41987: 'WhiteBalance',
                41988: 'DigitalZoomRation',
                41989: 'FocalLengthIn35mmFilm',
                41990: 'SceneCaptureType',
                41991: 'GainControl',
                41992: 'Contrast',
                41993: 'Saturation',
                41994: 'Sharpness',
                41995: 'DeviceSettingDescription',
                41996: 'SubjectDistanceRange',
                40965: 'InteroperabilityIFDPointer',
                42016: 'ImageUniqueID'
            }, C = P.TiffTags = {
                256: 'ImageWidth',
                257: 'ImageHeight',
                34665: 'ExifIFDPointer',
                34853: 'GPSInfoIFDPointer',
                40965: 'InteroperabilityIFDPointer',
                258: 'BitsPerSample',
                259: 'Compression',
                262: 'PhotometricInterpretation',
                274: 'Orientation',
                277: 'SamplesPerPixel',
                284: 'PlanarConfiguration',
                530: 'YCbCrSubSampling',
                531: 'YCbCrPositioning',
                282: 'XResolution',
                283: 'YResolution',
                296: 'ResolutionUnit',
                273: 'StripOffsets',
                278: 'RowsPerStrip',
                279: 'StripByteCounts',
                513: 'JPEGInterchangeFormat',
                514: 'JPEGInterchangeFormatLength',
                301: 'TransferFunction',
                318: 'WhitePoint',
                319: 'PrimaryChromaticities',
                529: 'YCbCrCoefficients',
                532: 'ReferenceBlackWhite',
                306: 'DateTime',
                270: 'ImageDescription',
                271: 'Make',
                272: 'Model',
                305: 'Software',
                315: 'Artist',
                33432: 'Copyright'
            }, I = P.GPSTags = {
                0: 'GPSVersionID',
                1: 'GPSLatitudeRef',
                2: 'GPSLatitude',
                3: 'GPSLongitudeRef',
                4: 'GPSLongitude',
                5: 'GPSAltitudeRef',
                6: 'GPSAltitude',
                7: 'GPSTimeStamp',
                8: 'GPSSatellites',
                9: 'GPSStatus',
                10: 'GPSMeasureMode',
                11: 'GPSDOP',
                12: 'GPSSpeedRef',
                13: 'GPSSpeed',
                14: 'GPSTrackRef',
                15: 'GPSTrack',
                16: 'GPSImgDirectionRef',
                17: 'GPSImgDirection',
                18: 'GPSMapDatum',
                19: 'GPSDestLatitudeRef',
                20: 'GPSDestLatitude',
                21: 'GPSDestLongitudeRef',
                22: 'GPSDestLongitude',
                23: 'GPSDestBearingRef',
                24: 'GPSDestBearing',
                25: 'GPSDestDistanceRef',
                26: 'GPSDestDistance',
                27: 'GPSProcessingMethod',
                28: 'GPSAreaInformation',
                29: 'GPSDateStamp',
                30: 'GPSDifferential'
            }, D = P.IFD1Tags = {
                256: 'ImageWidth',
                257: 'ImageHeight',
                258: 'BitsPerSample',
                259: 'Compression',
                262: 'PhotometricInterpretation',
                273: 'StripOffsets',
                274: 'Orientation',
                277: 'SamplesPerPixel',
                278: 'RowsPerStrip',
                279: 'StripByteCounts',
                282: 'XResolution',
                283: 'YResolution',
                284: 'PlanarConfiguration',
                296: 'ResolutionUnit',
                513: 'JpegIFOffset',
                514: 'JpegIFByteCount',
                529: 'YCbCrCoefficients',
                530: 'YCbCrSubSampling',
                531: 'YCbCrPositioning',
                532: 'ReferenceBlackWhite'
            }, F = P.StringValues = {
                ExposureProgram: {
                    0: 'Not defined',
                    1: 'Manual',
                    2: 'Normal program',
                    3: 'Aperture priority',
                    4: 'Shutter priority',
                    5: 'Creative program',
                    6: 'Action program',
                    7: 'Portrait mode',
                    8: 'Landscape mode'
                },
                MeteringMode: {
                    0: 'Unknown',
                    1: 'Average',
                    2: 'CenterWeightedAverage',
                    3: 'Spot',
                    4: 'MultiSpot',
                    5: 'Pattern',
                    6: 'Partial',
                    255: 'Other'
                },
                LightSource: {
                    0: 'Unknown',
                    1: 'Daylight',
                    2: 'Fluorescent',
                    3: 'Tungsten (incandescent light)',
                    4: 'Flash',
                    9: 'Fine weather',
                    10: 'Cloudy weather',
                    11: 'Shade',
                    12: 'Daylight fluorescent (D 5700 - 7100K)',
                    13: 'Day white fluorescent (N 4600 - 5400K)',
                    14: 'Cool white fluorescent (W 3900 - 4500K)',
                    15: 'White fluorescent (WW 3200 - 3700K)',
                    17: 'Standard light A',
                    18: 'Standard light B',
                    19: 'Standard light C',
                    20: 'D55',
                    21: 'D65',
                    22: 'D75',
                    23: 'D50',
                    24: 'ISO studio tungsten',
                    255: 'Other'
                },
                Flash: {
                    0: 'Flash did not fire',
                    1: 'Flash fired',
                    5: 'Strobe return light not detected',
                    7: 'Strobe return light detected',
                    9: 'Flash fired, compulsory flash mode',
                    13: 'Flash fired, compulsory flash mode, return light not detected',
                    15: 'Flash fired, compulsory flash mode, return light detected',
                    16: 'Flash did not fire, compulsory flash mode',
                    24: 'Flash did not fire, auto mode',
                    25: 'Flash fired, auto mode',
                    29: 'Flash fired, auto mode, return light not detected',
                    31: 'Flash fired, auto mode, return light detected',
                    32: 'No flash function',
                    65: 'Flash fired, red-eye reduction mode',
                    69: 'Flash fired, red-eye reduction mode, return light not detected',
                    71: 'Flash fired, red-eye reduction mode, return light detected',
                    73: 'Flash fired, compulsory flash mode, red-eye reduction mode',
                    77: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected',
                    79: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected',
                    89: 'Flash fired, auto mode, red-eye reduction mode',
                    93: 'Flash fired, auto mode, return light not detected, red-eye reduction mode',
                    95: 'Flash fired, auto mode, return light detected, red-eye reduction mode'
                },
                SensingMethod: {
                    1: 'Not defined',
                    2: 'One-chip color area sensor',
                    3: 'Two-chip color area sensor',
                    4: 'Three-chip color area sensor',
                    5: 'Color sequential area sensor',
                    7: 'Trilinear sensor',
                    8: 'Color sequential linear sensor'
                },
                SceneCaptureType: {0: 'Standard', 1: 'Landscape', 2: 'Portrait', 3: 'Night scene'},
                SceneType: {1: 'Directly photographed'},
                CustomRendered: {0: 'Normal process', 1: 'Custom process'},
                WhiteBalance: {0: 'Auto white balance', 1: 'Manual white balance'},
                GainControl: {0: 'None', 1: 'Low gain up', 2: 'High gain up', 3: 'Low gain down', 4: 'High gain down'},
                Contrast: {0: 'Normal', 1: 'Soft', 2: 'Hard'},
                Saturation: {0: 'Normal', 1: 'Low saturation', 2: 'High saturation'},
                Sharpness: {0: 'Normal', 1: 'Soft', 2: 'Hard'},
                SubjectDistanceRange: {0: 'Unknown', 1: 'Macro', 2: 'Close view', 3: 'Distant view'},
                FileSource: {3: 'DSC'},
                Components: {0: '', 1: 'Y', 2: 'Cb', 3: 'Cr', 4: 'R', 5: 'G', 6: 'B'}
            }, U = {
                120: 'caption',
                110: 'credit',
                25: 'keywords',
                55: 'dateCreated',
                80: 'byline',
                85: 'bylineTitle',
                122: 'captionWriter',
                105: 'headline',
                116: 'copyright',
                15: 'category'
            };
            P.enableXmp = function () {
                P.isXmpEnabled = !0;
            }, P.disableXmp = function () {
                P.isXmpEnabled = !1;
            }, P.getData = function (t, e) {
                return !((self.Image && t instanceof self.Image || self.HTMLImageElement && t instanceof self.HTMLImageElement) && !t.complete) && (o(t) ? e && e.call(t) : c(t, e), !0);
            }, P.getTag = function (t, e) {
                if (o(t)) return t.exifdata[e];
            }, P.getIptcTag = function (t, e) {
                if (o(t)) return t.iptcdata[e];
            }, P.getAllTags = function (t) {
                if (!o(t)) return {};
                var e, n = t.exifdata, i = {};
                for (e in n) n.hasOwnProperty(e) && (i[e] = n[e]);
                return i;
            }, P.getAllIptcTags = function (t) {
                if (!o(t)) return {};
                var e, n = t.iptcdata, i = {};
                for (e in n) n.hasOwnProperty(e) && (i[e] = n[e]);
                return i;
            }, P.pretty = function (t) {
                if (!o(t)) return '';
                var e, n = t.exifdata, i = '';
                for (e in n) n.hasOwnProperty(e) && ('object' == typeof n[e] ? n[e] instanceof Number ? i += e + ' : ' + n[e] + ' [' + n[e].numerator + '/' + n[e].denominator + ']\r\n' : i += e + ' : [' + n[e].length + ' values]\r\n' : i += e + ' : ' + n[e] + '\r\n');
                return i;
            }, P.readFromBinaryFile = function (t) {
                return l(t);
            }, i = [], void 0 !== (r = function () {
                return P;
            }.apply(e, i)) && (t.exports = r);
        }).call(this);
    }
}, [258]);